export default {
  namespaced: true,
  state: {
    layerIds: [],
    objectIds: []
  },
  mutations: {
    addLayerId(state, id) {
      if (!state.layerIds.includes(id)) {
        state.layerIds.push(id);
      }
    },
    removeLayerId(state, id) {
      let ids = state.layerIds;
      if (ids.includes(id)) {
        ids.splice(ids.indexOf(id), 1);
      }
    },
    addObjectId(state,id){
      if (!state.layerIds.includes(id)) {
        state.objectIds.push(id);
      }
    },
    removeObjectId(state,id){
      let ids = state.objectIds;
      if (ids.includes(id)) {
        ids.splice(ids.indexOf(id), 1);
      }
    }
  }
}